package sketch.generator.examples;

import sketch.util.SketchUtil;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class ExhaustiveSequentialValueGeneratorTest extends TestCase {

	public static Test suite() {
        return new TestSuite(ExhaustiveSequentialValueGeneratorTest.class);
    }
	
	public void testSequentialValueGenerator() {
		ExhaustiveSequatialValueGenerator<String> generator =
			new ExhaustiveSequatialValueGenerator<String>("string1", "string2", "string3", "string4", "string5");
		
		int i = 0;
		while(generator.hasNext()) {
			SketchUtil.stdln((++i) + "th value:");
			SequentialValue<String> strValue = generator.next();
			SketchUtil.stdln(strValue);
		}
		
		assertTrue(i == 5 + 5*5 + 5*5*5 + 5*5*5*5 + 5*5*5*5*5);
	}
}
